$(".btn-login").click(function(){

	var account = $("#account").val();
	var password = $("#password").val();

	if (!$.trim(account).length) {
		mui.toast("请输入账号",{ duration:200000, type:'div' });
		return;
	}
	if (!$.trim(password).length) {
		mui.toast("请输入密码");
		return;
	}
	
	Server.postToService("/verify",{"account":account,"password":password}, function(result){
		if (result.code === 200) {
			console.log(result.data);
			setCookie("service_user_id",result.data.id);
			setCookie("service_user_name",result.data.name);
			window.location.href= "html/index.html";
		} else if (result.code === 201) {
			weui.toast("用户名不存在!!!")
		} else if (result.code === 202) {
			weui.toast("密码错误!!!");
		} else {
			weui.toast("系统繁忙,请稍后再试!");
		}
	})
})
